﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Sql;

namespace dpmagnet.Data
{
    public interface IDBProcessor
    {
        bool Delete(string sql);
        bool GetBool(string sql);
        System.Data.DataTable GetDataTable(string sql);
        DateTime GetDatetime(string sql);
        decimal GetDecimal(string sql);
        int GetInt(string sql);
        object GetObject(string sql);
        string GetString(string sql);
        bool Insert(string sql);
        int Update(string sql);
    }


    public class DataProcessorGenerator
    {
        DataBaseType _dbtype;

        public DataProcessorGenerator(DataBaseType dbType)
        {
            _dbtype = dbType;
        }

        public IDBProcessor GetDataProcessor()
        {
            switch (_dbtype)
            {
                case DataBaseType.MSSQL:
                    {
                        return new DBProc_SQLServer("");
                    }
                default:
                    throw new NotImplementedException();
            }
        }
    }

    public enum DataBaseType
    {
        MSSQL,
        MySQL,
        SQLite,
        Access,
        UnDefined
    }
}
